package com.example.mobile2021606185zhn0615;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private RecyclerView rvMaintUsers;
    private List<Users> list = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list.add(new Users(1,"张三",20,90));
        list.add(new Users(2,"李四",25,80));
        list = new MyDataAdapter().QuerAll(this);
         rvMaintUsers.setAdapter(new UsersRViewAdapter(list));
;
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tvMainTitle);
        rvMaintUsers = (RecyclerView) findViewById(R.id.rvMaintUsers);
        rvMaintUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}